-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Remote Functions #13986
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Remote Functions #13986
Conversation
* initial commit * various fixes * tweak demo * fix * remove acorn-typescript * simplify * fix * generate, don't transform * use an x- header * regenerate manifest when remote files are added/removed * move RPC logic out of page, it belongs elsewhere * use _app/remote/x * tighten up error handling * unused * CSRF * smaller payloads * belt and braces * don't use 204, that only applies to DELETE/PUT requests * turn remote_call into a factory - more compact and gives us a lot more options * analyze exports of remotes dynamically, add query/action/formAction as different types of remotes * update playground * POC: hydrate query results * remote form actions that hydrate and work without JS * conditional * load fn WIP * rerun query on invalidation * make it possible to call invalidate in rpc functions * fix * adjust form API * fix dev stale bug * let rpc partake in prerendering * prerender POC * cache POC * simplify server remote logic by leveraging ESM self imports * cleanup server remote info * rename functions + some docs * move more stuff into functions to deduplicate/cleanup/make connections clearer * prerendering * hide remote url, avoid unnecessary work * cache refinement * various fixes * tests * don't call prerender function at runtime, tweak tests * tweak * tweak caching behavior * remove cache function from public API for now * add experimental flag * remove load helper function for now * move file * add refreshAll, related to #13139 * adjust overrides signature * query/redirect/form-fail handling * adjust caching behavior to cache until query is removed * disallow non-remote-function exports from .remote files * bump dts-buddy to be able to generate types without bugs again * handle query redirect without going through error boundaries * harmonize refresh with override signature * fixes * resolve cyclic import dependency * prerender treeshaking * refine API * refresh from the server * adjust tests, fix * adjust prerender * reorder functions * make query eager on the client if in reactive context * implement current/error/pending * remove optimistic in favor of override callback * add validate * form.for(...) * tweak api around redirects; allow single flight mutation redirect * implement stacking override API * fixes * deduplicate remote calls on the server during full page visits * rework to use resource class, fix some bugs * ensure refresh/then resolve in order * microtask tweaking * fix * cleanse event for remote functions * implement `updates` and `withOverride` for command * implement `updates` and `withOverride` for form * cleanup * Prevent state_unsafe_mutation error * restrict to 0 or 1 argument, enforce validation * validation tests * tweak * comment out for the time being * remove validate function * lint * guard * bump Svelte version * silence type errors * Update packages/kit/src/runtime/app/server/remote.js Co-authored-by: Paolo Ricciuti <[email protected]> * fix * update playground --------- Co-authored-by: Dominic Gannaway <[email protected]> Co-authored-by: Rich Harris <[email protected]> Co-authored-by: Paolo Ricciuti <[email protected]>
|
PR for #13897, discussion should happen there.
For a more complete commit history (with lots of explorations and dead ends; also includes some caching ideas) see #13957
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
Tests
pnpm test
and lint the project withpnpm lint
andpnpm check
Changesets
pnpm changeset
and following the prompts. Changesets that add features should beminor
and those that fix bugs should bepatch
. Please prefix changeset messages withfeat:
,fix:
, orchore:
.